This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Remove most of the state from WasmContext. #138
Merged
tanishiking
merged 11 commits into
tanishiking:main
from
sjrd:remove-state-from-wasmcontext
May 22, 2024
Merged
Remove most of the state from WasmContext. #138
tanishiking
merged 11 commits into
tanishiking:main
from
sjrd:remove-state-from-wasmcontext
May 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We can allocate the IDs without looking at the body of methods, so this allows to have a fixed assignment from the start.
We can use `stringPool.size` instead.
We can compute that in `Emitter.genStartFunction` instead with no additional cost.
The use sites that need that information already have a `LinkedClass` from which they can get it.
Compute the two internal information that needed it from `Preprocessor` instead.
Instead, keep the stateful computations inside `Preprocessor`, and freeze the state when constructing `WasmContext`. This means that it is the responsibility of `Preprocessor` to create the instance of `WasmContext`, instead of `Emitter`.
We already have the set of all imported modules. There is no need to compute it while generating code.
We can recompute it in `genStartFunction` instead.
sjrd
force-pushed
the
remove-state-from-wasmcontext
branch
from
May 21, 2024 12:17
f4ccc1e
to
892fdc5
Compare
Rebased. |
tanishiking
approved these changes
May 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The only state that is left in
WasmContext
is directly related to code generation, rather than building knowledge about the program.Based on #137, but otherwise reviewable.